package com.rabbit.mq.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version V1.0.0
 * @ClassName: {@link AckRabbitConfig}
 * @Description: DirectRabbitConfig
 * @author: Lanzhou
 * @date: 2021/3/17 9:41
 * @Copyright:2020 All rights reserved.
 */
@Configuration
public class AckRabbitConfig {

    @Bean
    public Queue queueAck() {
        return new Queue("queueAck", false);
    }

    @Bean
    public Exchange exchangeAck() {
        return new DirectExchange("exchangeAck", true, true);
    }

    @Bean
    public Binding bindingAck() {
        return BindingBuilder.bind(queueAck()).to(exchangeAck()).with("queue_exchange_ack").noargs();
    }

    @Bean
    DirectExchange lonelyDirectExchange() {
        return new DirectExchange("lonelyDirectExchange");
    }

}
